/*
 * Classname Synonym.java
 * 
 * Version Information
 * Date Mar 20, 2006
 *
 * Copyright (c) AmSoft Systems, 2006
 */
package net.amsoft.iservice.isso.hibernate;

import net.amsoft.iservice.util.exception.IServiceException;
import org.apache.log4j.Logger;

public class Synonym extends ISSOObject {
    private static Logger logger = Logger.getLogger(Synonym.class);
    private Long id;
    private String sSynonym;
    private Principal oPrincipal;
    private Synonym sGlobalINumber;
    protected short state;

    public Synonym() {
    }

    public Long getId() {
        return id;
    }
    private void setId(Long id) {
        this.id = id;
    }
    
    public String getSynonym() {
        return this.sSynonym;
    }
    public void setSynonym(String synonym) {
        this.sSynonym = synonym;
    }
    
    public Principal getPrincipal() {
        return this.oPrincipal;
    }
    public void setPrincipal(Principal principal) {
        this.oPrincipal = principal;
    }
    
    public short getState() {
        return state;
    }
    public void setState(short state) {
        this.state = state;
    }

    public Synonym getGlobalINumber() {
        return this.sGlobalINumber;
    }
    public void setGlobalINumber(Synonym globalINumber) {
        this.sGlobalINumber = globalINumber;
    }
    
    public void debug(String prefix) {
        logger.debug(prefix + " : Synonym (" + id + ", " + sSynonym + ", "
                + oPrincipal.getId() + ", " + state + ")");
    }

    public ISSOObject insert() throws IServiceException {
        this.setState(state);
        this.setPrincipal(oPrincipal);
        return (this);
    }
}